package com.hspedu.override_.exercise;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/1/23
 * @time 16:41
 */
public class Test {
    public static void main(String[] args) {
        Father father = new Son("jack",18,"eng",100);
        System.out.println(father.name);
    }
}

class GrandPa{
     String name;
     int age;

    public GrandPa(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class Father extends GrandPa{
    public Father(String name, int age, String major) {
        super(name, age);
        this.major = major;
    }

     String major;
}
class Son extends Father{
    public Son(String name, int age, String major, double score) {
        super(name, age, major);
        this.score = score;
    }

     double score;
}
